<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-organization-edit" th:object="${organization}">
		<div class="form-group">
			<label class="col-sm-3 control-label">区域名称：</label>
			<div class="col-sm-8">
				<input id="aname" name="aname" th:field="*{aname}" class="form-control" type="text" onclick="selectAidTree()" readonly="readonly">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">IMEI号：</label>
			<div class="col-sm-8">
				<input id="tid" name="tid" th:field="*{tid}" class="form-control" type="text" readonly="readonly">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">终端设备名称：</label>
			<div class="col-sm-8">
				<input id="tname" name="tname" th:field="*{tname}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">创建时间：</label>
			<div class="col-sm-8">
				<!--<input id="tname" name="tname" th:field="*{createdtime}" class="form-control" type="text">-->
				<input name="createdtime" class="laydate-icon form-control layer-date"
					   id="broaddate" value="" readonly="readonly" style="width:120px;"
					   placeholder="创建时间" title="创建时间"/>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">终端交互时间：</label>
			<div class="col-xs-8">
				<input class="form-control" name="intertime" id="intertime" value="23:00:01" type="time"  placeholder="请输入终端交互时间">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">手机号码：</label>
			<div class="col-sm-8">
				<input id="phone" name="phone" th:field="*{phone}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">安装地址：</label>
			<div class="col-sm-8">
				<input id="address" name="address" th:field="*{address}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">出厂编号：</label>
			<div class="col-sm-8">
				<input id="facid" name="facid" th:field="*{facid}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">终端接入通信网标准：</label>
			<div class="col-sm-8">
				<select class="chosen-select form-control" th:field="*{comstand}"  name="comstand" id="comstand">
					<option value="WCDMA">WCDMA</option>
					<option value="TDSCDMA">TDSCDMA</option>
					<option value="CDMA2000">CDMA2000</option>
					<option value="GPRS">GPRS</option>
					<option value="WIFI">WIFI</option>
					<option value="TDDLTE">TDDLTE</option>
					<option value="FDDLTE">FDDLTE</option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">终端接入电视网模式：</label>
			<div class="col-sm-8">
				<select class="chosen-select form-control" th:field="*{broadtel}"  name="broadtel" id="broadtel">
					<option value="有线网">有线网</option>
					<option value="无线网">无线网</option>
					<option value="数字电视网">数字电视网</option>
					<option value="卫星电视网">卫星电视网</option>
					<option value="互联网">互联网</option>
					<option value="其他">其他</option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">RDS码：</label>
			<div class="col-sm-8">
				<input id="rds" name="rds" th:field="*{rds}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">终端可收转广播频率：</label>
			<div class="col-sm-8">
				<input id="fmfrequency" name="fmfrequency" th:field="*{fmfrequency}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">终端管理员：</label>
			<div class="col-sm-8">
				<input id="manager" name="manager" th:field="*{manager}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">终端管理员电话：</label>
			<div class="col-sm-8">
				<input id="managertel" name="managertel" th:field="*{managertel}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">是否可用：</label>
			<div class="col-sm-8">
                <li>
                    <input type="radio" name="isuse" value="true" style="width: 50px">是
                    <input type="radio" name="isuse" value="false" style="width: 50px">否
                </li>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">备注：</label>
			<div class="col-sm-8">
				<input id="note" name="note" th:field="*{note}" class="form-control" type="text">
			</div>
		</div>

	</form>
</div>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/js/jquery.tips.js}"></script>
<script th:src="@{/js/views/addpglist/addpglist.js}"></script>
<script th:src="@{/js/plugins/layer/laydate/laydate.js}"></script>
<script th:src="@{/js/plugins/layer/layui-v2.4.5/layui/layui.js}"></script>
<!--时间插件-->
<script>
    laydate({
        elem:"#broaddate",
        event:"focus"
    });
    laydate({
        elem:"#broaddate",
        event:"focus"
    });
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem:"#broad",
            type: 'time',
        });
    });
</script>
<script>
    $(document).ready(function(){$(".sortable-list").sortable({connectWith:".connectList"}).disableSelection()});
</script>
<div th:include="include::footer"></div>
<script type="text/javascript">
	var prefix = ctx + "broad/organization"
	$("#form-organization-edit").validate({
		rules:{
			xxxx:{
				required:true,
			},
		}
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/edit", $('#form-organization-edit').serialize());
		}
	}

	/*用户管理-新增-选择用户所属区域树*/
	function selectAidTree() {
		var url = "/broad/organization/selectAidTree";
		var options = {
			title: '选择区域',
			width: "380",
			url: "/broad/organization/selectAidTree",
			callBack: doSubmitAid
		};
		$.modal.openOptions(options);
	}

	function doSubmit(index, layero){
		var tree = layero.find("iframe")[0].contentWindow.$._tree;
		if ($.tree.notAllowParents(tree)) {
			var body = layer.getChildFrame('body', index);
			$("#treeId").val(body.find('#treeId').val());
			$("#treeName").val(body.find('#treeName').val());
			layer.close(index);
		}
	}

	/*该模块是选择用户所属区域树的提交功能模块，body.find()方法中该使用框架固定的treeId、treeName*/
	function doSubmitAid(index, layero){
		var tree = layero.find("iframe")[0].contentWindow.$._tree;
		if ($.tree.notAllowParents(tree)) {
			var body = layer.getChildFrame('body', index);
			$("#aid").val(body.find('#treeId').val());
			$("#aname").val(body.find('#treeName').val());
			/*console.log(body.find('#treeId').val());
            console.log(body.find('#treeName').val());*/
			layer.close(index);
		}
	}
</script>
</body>
</html>
